{% extends "base.html" %}
{% block title %} Список грузов {% endblock %}

{% block css-js %}
    {#    {% load static %}#}
    {#    <script src="{% static '' %}"></script>#}
{% endblock %}

{% block content %}

    <div class="container position-relative">
        <div class="modal-dialog m-3">
            <div class="modal-content">
                <div class="modal-header float-right">
                    <h5>Информация по посылке</h5>
                    <div class="text-right">
                        <i data-dismiss="modal" aria-label="Close" class="fa fa-close"></i>
                    </div>
                </div>

                <div class="modal-body">
                    <div>
                        <table class="table table-bordered">
                            <tbody>
                            <tr>
                                <td>Адрес отправления</td>
                                <td>{{ cargo.pick_up_location }}</td>
                            </tr>
                            <tr>
                                <td>Адрес доставки</td>
                                <td>{{ cargo.deliver_location }}</td>
                            </tr>
                            <tr>
                                <td>Вес посылки</td>
                                <td>{{ cargo.cargo_weight }}</td>
                            </tr>
                            <tr>
                                <td>Описание</td>
                                <td>{{ cargo.description }}</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="modal-body">


                    <div>

                        <div>
                            <a type="button" class="btn btn-info m-2" href="{% url "cargo_update" pk=cargo.pk %}">Редактировать</a>
                        </div>
                        <table class="table table-bordered">
                            <tbody>
                            {% for car in cars %}
                                <tr>
                                    <td>Номер машины</td>
                                    <td>{{ car.unique_car_number }}</td>
                                    <td>Полный вес</td>
                                    <td>{{ car.payload_type }}</td>
                                    <td>Расстояние</td>
                                    <td>{{ car.distance }}</td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                </div>

            </div>
        </div>
    </div>

{% endblock %}